package org.lsb.app_back.service;

import org.lsb.app_back.domain.BackendUser;
import org.lsb.app_back.mapper.BackendUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BackendUserService {

    @Autowired
    private BackendUserMapper backendUserMapper;

    /**
     * 验证管理员用户
     * @param userCode 用户编码
     * @param password 用户密码
     * @return 是否验证通过
     */
    public BackendUser authenticateBackendUser(String userCode, String password) {
        BackendUser backendUser=backendUserMapper.findByUserCodeAndPassword(userCode, password);
        if(backendUser!=null){
            return backendUser;
        }else {
            return null;
        }

    }
}


